package com.lianniu.web.seller.service.impl;

import com.lianniu.web.base.BaseResult;
import com.lianniu.web.seller.dao.ISupplyBaseDao;
import com.lianniu.web.seller.service.ISupplyRegisterService;
import com.lianniu.web.seller.vo.Supply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2017-05-09.
 */
@Service
public class SupplyRegisterServiceImpl implements ISupplyRegisterService {
    @Autowired
    ISupplyBaseDao supplyBaseDao;
    @Override
    public BaseResult deleteByPrimaryKey(Long supplyid) {
        int i = supplyBaseDao.deleteByPrimaryKey(supplyid);
        return BaseResult.success(i);
    }

    @Override
    public BaseResult insert(Supply record) {
        int i = supplyBaseDao.insert(record);
        return BaseResult.success(i);
    }

    @Override
    public BaseResult insertSelective(Supply record) {
        int i = supplyBaseDao.insertSelective(record);
        return BaseResult.success(i);
    }

    @Override
    public BaseResult selectByPrimaryKey(Long supplyid) {
        Supply supply = supplyBaseDao.selectByPrimaryKey(supplyid);
        return BaseResult.success(supply);
    }
    @Override
    public BaseResult selectByUserId(String userId) {
        Supply supply = supplyBaseDao.selectByUserId(Long.valueOf(userId));
        return BaseResult.success(supply);
    }

    @Override
    public BaseResult updateByPrimaryKeySelective(Supply record) {
        int i = supplyBaseDao.updateByPrimaryKeySelective(record);
        return BaseResult.success(i);
    }

    @Override
    public BaseResult updateByPrimaryKey(Supply record) {
        int i = supplyBaseDao.updateByPrimaryKey(record);
        return BaseResult.success(i);
    }
}
